#!/bin/bash

#  3 4 6, 7 9 11 13 14 15 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 34 35

randacctime=1500
splitacctime=600
memoryblockGB=14
#memoryblockGB=10
#memoryblockGB=15

#for j in 1 2 5 10 20 50; do
j=10
    echo "- Test For $j Megabytes Block -"
    let "size = $j *1024 * 1024"
    for ((i=1; i < 20; i++)); do
        if [ $i -lt 19 ]; then
            continue;
        fi
        echo -n "- JOB $i TEST START @@- , "

        ../disktest/randtest $i $randacctime $size $memoryblockGB &
        sleep 100 && ./splitacc.sh $i $splitacctime $j &

        wait

        if [ ! -d ./singlethread/${j}M ] ; then
            mkdir ./singlethread/${j}M
        fi

        mkdir ./singlethread/${j}M/$i
        mv t_*.dat ./singlethread/${j}M/$i/

        echo -e "- JOB $i TEST DONE $\$ -"
    done

    for i in 25 30 40; do
        echo -n "- JOB $i TEST START @@- , "

        ../disktest/randtest $i $randacctime $size $memoryblockGB &
        sleep 100 && ./splitacc.sh $i $splitacctime $j &

        wait

        if [ ! -d ./singlethread/${j}M ] ; then
            mkdir ./singlethread/${j}M
        fi
        mkdir ./singlethread/${j}M/$i
        mv t_*.dat ./singlethread/${j}M/$i/

        echo -e "- JOB $i TEST DONE $\$ -"
    done
    echo "- Test For $j Megabytes Block Done -"
#done 

